#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project  : ecshop
# @File     : page_backend_install_and_uninstall_pay.py
# @Author   : WanLiWei
# @Time     : 2021/7/3 16:58
class PageBackendInstallAndUninstallPay():
    def __init__(self,driver):
        self.driver=driver
    def test_click_systeml(self):
        # 进入id为menu-frame的frame
        self.driver.switch_to.frame('menu-frame')
        # 点击系统管理
        self.driver.find_element_by_xpath('//ul[@id="menu-ul"]/li[9]').click()
    def test_pay_mode(self):
        # 点击支付方式
        self.driver.find_element_by_xpath('//ul[@id="menu-ul"]/li[9]/ul/li[3]/a').click()

        # 退出frame
        self.driver.switch_to.default_content()
    def test_click_install(self):
        # 进入id为main-frame的frame
        self.driver.switch_to.frame('main-frame')
        # 点击安装按钮
        self.driver.find_element_by_xpath('//div[@id="listDiv"]/table/tbody/tr[6]/td[7]/a').click()
    def test_click_confirm(self):
        # 点击确定按钮
        self.driver.find_element_by_xpath('/html/body/form/div/table/tbody/tr[6]/td/input[5]').click()
        # 退出frame
        self.driver.switch_to.default_content()
    def test_click_uninstall(self):
        # 进入id为main-frame的frame
        self.driver.switch_to.frame('main-frame')
        self.driver.find_element_by_xpath('//div[@id="listDiv"]/table/tbody/tr[6]/td[7]/a[1]').click()
    def test_click_arlet_confirm(self):
        # 弹框点确定
        self.driver.switch_to.alert.accept()
        # 退出frame
        self.driver.switch_to.default_content()
    def test_install_pay(self):
        self.test_click_systeml()
        self.test_pay_mode()
        self.test_click_install()
        self.test_click_confirm()
    def test_uninstall_pay(self):
        self.test_click_systeml()
        self.test_pay_mode()
        self.test_click_uninstall()
        self.test_click_arlet_confirm()